﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls.WebParts;

using Microsoft.SharePoint;

namespace SharePointHarvester.Events {
    public delegate void WebPartFoundHandler( object sender, WebPartFoundEventArg e );

    /// <summary>
    /// When a webpart is found on a aspx page
    /// </summary>
    public class WebPartFoundEventArg : EventArgs {
        /// <summary>
        /// The web that was found
        /// </summary>
        public SPWeb _spWeb;
        /// <summary>
        /// List that has been found
        /// </summary>
        public SPList _list;
        /// <summary>
        /// Item that has been found
        /// </summary>
        public SPListItem _item;
        /// <summary>
        /// ASPX Page
        /// </summary>
        public SPFile _file = null;
        /// <summary>
        /// Webpart found on the page
        /// </summary>
        public WebPart _webPart = null;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="webFound"></param>
        /// <param name="list"></param>
        /// <param name="item"></param>
        /// <param name="file"></param>
        /// <param name="webpart"></param>
        public WebPartFoundEventArg( SPWeb webFound, SPList list, SPListItem item, SPFile file, WebPart webpart ) {
            _spWeb = webFound;
            _list = list;
            _item = item;
            _file = file;
            _webPart = webpart;
        }
    }
}
